package maze;

import java.applet.Applet;
import java.awt.BorderLayout;
import java.net.MalformedURLException;
import java.net.URL;

/**
 *
 * @author Dennis Nijssen
 */
public class MainApplet extends Applet {
    
    /**
     * Initialization method that will be called after the applet is loaded
     * into the browser.
     */
    public void init() {
        setLayout(new BorderLayout());
        add(new Game(this, getCodeBase(), getParameter("xml")), BorderLayout.CENTER);
    }
    
    public void jsSetData(String data) {
        try {
            getAppletContext().showDocument(new URL("javascript:setData(\"" + data + "\")"));
        } catch(MalformedURLException e) {
        }
    }
}
